
<!DOCTYPE html>
<html lang="en">

<head>
    <title>视频分享</title>
    <meta charset="UTF-8">
    <meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1">
    <meta name="Keywords" content="V聊" />
    <meta name="Description" content="高颜值一对一视频聊天" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    
   <script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
   
   
     <style type="text/css">
	 * {
	margin:0px;
	padding:0px;
	box-sizing:border-box;
	outline:none;
	-webkit-tap-highlight-color:transparent
}
html {
	font-size:14px
}
body {
	font-family:"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
	background-color:#EAEAEA
}
ol,ul {
	list-style:outside none none
}
a {
	text-decoration:none
}
a:hover {
	text-decoration:none
}
img {
	border:0;
	vertical-align:middle
}
input {
	-webkit-appearance:none
}
.app-btn-circle {
	background:linear-gradient(to right, #F24D60, #FF8A78);
	color:#ffffff;
	border-radius:2.4rem;
	display:inline-block;
	text-align:center
}
.large {
	width:6.8rem;
	line-height:2.6rem;
	box-shadow:0px 1px 2px #f5aaaa;
	font-size:1.2rem
}
.small {
	width:4.3rem;
	line-height:1.9rem
}
.app-layout-1,.app .header,.app .header .app-logo,.app .video-box .video-show .video-tool,.app .video-box .video-show .video-tool .tool-explain {
	display:flex;
	justify-content:space-between;
	align-items:center
}
.app-layout-2,.app .video-hot .video-list .video-item .video-content .content-explain,.app .video-hot .video-list .video-item .video-content .content-explain .ce-c .ce-count {
	display:flex;
	align-items:center
}
.app-layout-3,.app .video-hot .video-list {
	display:flex;
	flex-wrap:wrap
}
.app-layout-4,.app .video-play .play-tool {
	display:flex;
	flex-direction:column;
	align-items:center
}
.app-img-1 {
	width:2.4rem;
	height:2.4rem;
	border-radius:100%;
	border:1px solid #ffffff
}
.app-img-2 {
	width:1.2rem;
	height:1.2rem
}
.app-img-3 {
	width:3rem;
	height:3rem;
	opacity:0.9
}
.app-img-4 {
	width:3.5rem;
	height:3.5rem;
	opacity:0.9
}
.app-img-5 {
	width:3.4rem;
	height:3.4rem;
	border-radius:100%;
	border:1px solid #ffffff
}
.play {
	position:absolute;
	top:50%;
	left:50%;
	margin-top:-2.5rem;
	margin-left:-2.5rem
}
.play img {
	width:5rem
}
.app .header {
	background-color:#ffffff;
	padding:0.5rem 1.5rem 0.5rem 1rem;
	position:fixed;
	top:0px;
	width:100%;
	z-index:10000
}
.app .header .app-logo img {
	width:3rem
}
.app .header .app-logo p {
	font-size:1.2rem;
	color:#606060;
	font-family:"Microsoft JhengHei";
	padding-left:1rem
}
.app .video-box {
	margin-top:4rem
}
.app .video-box .video-show {
	position:relative
}
.app .video-box .video-show .video-img {
	min-height:36rem;
	background-position:center center;
	background-repeat:no-repeat;
	background-size:cover
}
.app .video-box .video-show .video-tool {
	width:100%;
	position:absolute;
	bottom:0px;
	background-color:rgba(75,75,75,0.5);
	padding:0.7rem 1.5rem 0.7rem 1rem
}
.app .video-box .video-show .video-tool .tool-explain p {
	font-size:1.2rem;
	color:#ffffff;
	padding-left:1rem
}
.app .video-play {
	display:none;
	position:fixed;
	top:0px;
	left:0px;
	min-width:100%;
	min-height:100%;
	overflow:hidden
}
.app .video-play .play-tool {
	position:absolute;
	right:1rem;
	bottom:9rem
}
.app .video-play .play-tool .pt-t {
	padding-bottom:1.2rem;
	text-align:center
}
.app .video-play .play-tool .pt-t p {
	color:#ffffff;
	font-size:0.9rem;
	font-weight:bolder
}
.app .video-play .play-tool .pt-name {
	padding-bottom:2rem
}
.app .video-play .player {
	position:absolute;
	background-color:#000000;
	width:100%;
	height:100%;
	z-index:-1
}
.app .video-play .close {
	position:absolute;
	right:1rem;
	top:1rem
}
.app .video-hot .hot-title {
	text-align:center;
	color:#757575;
	font-size:1.2rem;
	position:relative;
	padding-top:1rem;
	padding-bottom:1rem;
	background-color:#ffffff;
	margin-top:2px;
	margin-bottom:2px
}
.app .video-hot .hot-title p {
	position:relative;
	display:inline;
	z-index:1;
	background-color:#ffffff;
	padding-left:5px;
	padding-right:5px
}
.app .video-hot .hot-title .hot-hr {
	width:60%;
	border:none;
	border-top:1px solid #757575;
	position:absolute;
	top:50%;
	left:20%
}
.app .video-hot .video-list {
	overflow:hidden
}
.app .video-hot .video-list .video-item:nth-child(2n) {
	padding-left:1px
}
.app .video-hot .video-list .video-item:nth-child(2n+1) {
	padding-right:1px
}
.app .video-hot .video-list .video-item {
	position:relative;
	padding-bottom:2px;
	width:50%
}
.app .video-hot .video-list .video-item .item-img {
	min-height:18rem;
	background-color:#dedede;
	background-position:center center;
	background-repeat:no-repeat;
	background-size:cover
}
.app .video-hot .video-list .video-item .video-content {
	position:absolute;
	bottom:0px;
	width:100%;
	padding:0.5rem 1rem 0.5rem 1rem;
	opacity:0.8
}
.app .video-hot .video-list .video-item .video-content .content-explain p {
	font-size:1rem;
	color:#f5f5f5
}
.app .video-hot .video-list .video-item .video-content .content-explain .ce-c {
	padding-left:1rem
}
.app .video-hot .video-list .video-item .video-content .content-explain .ce-c .ce-count p {
	padding-left:0.3rem;
	font-size:0.9rem
}
.app .header-paly {
	top:auto;
	bottom:0px;
	background-color:rgba(255,255,255,0.7)
}
.app {position: absolute;}
.center{text-align: center;}
        .login-page {
            width: 360px;
            padding: 8% 0 0;
            margin: auto;
        }
        .form {
            position: relative;
            z-index: 1;
            background: #FFFFFF;
            max-width: 360px;
            margin: 200px 25px 100px;
            padding: 25px;
            text-align: center;
            box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
        }
        .form input {
            font-family: "Roboto", sans-serif;
            outline: 0;
            background: #f2f2f2;
            width: 85%;
            border: 0;
            margin: 0 0 20px;
            padding: 5px;
            box-sizing: border-box;
            font-size: 14px;
            border-radius:6px
        }
        .form button {
            font-family: "Microsoft YaHei","Roboto", sans-serif;
            text-transform: uppercase;
            outline: 0;
            background: #D8D8D8;
            width: 100%;
            border: 0;
            padding: 15px;
            color: #1a1a1a;
            font-size: 14px;
            -webkit-transition: all 0.3 ease;
            transition: all 0.3 ease;
            cursor: pointer;
            border-radius:6px
        }

        .form .message {
            margin: 15px 0 0;
            color: #b3b3b3;
            font-size: 12px;
        }
        .form .message a {
            color: #4CAF50;
            text-decoration: none;
        }
        .form .register-form {
            display: none;
        }
        .container {
            position: relative;
            z-index: 1;
            max-width: 300px;
            margin: 0 auto;
        }
        .container:before, .container:after {
            content: "";
            display: block;
            clear: both;
        }
        .container .info {
            margin: 50px auto;
            text-align: center;
        }
        .container .info h1 {
            margin: 0 0 15px;
            padding: 0;
            font-size: 36px;
            font-weight: 300;
            color: #1a1a1a;
        }
        .container .info span {
            color: #4d4d4d;
            font-size: 12px;
        }
        .container .info span a {
            color: #000000;
            text-decoration: none;
        }
        .container .info span .fa {
            color: #EF3B3A;
        }

        .shake_effect{
            -webkit-animation-name: shake;
            animation-name: shake;
            -webkit-animation-duration: 1s;
            animation-duration: 1s;
        }
        @-webkit-keyframes shake {
            from, to {
                -webkit-transform: translate3d(0, 0, 0);
                transform: translate3d(0, 0, 0);
            }

            10%, 30%, 50%, 70%, 90% {
                -webkit-transform: translate3d(-10px, 0, 0);
                transform: translate3d(-10px, 0, 0);
            }

            20%, 40%, 60%, 80% {
                -webkit-transform: translate3d(10px, 0, 0);
                transform: translate3d(10px, 0, 0);
            }
        }

        @keyframes shake {
            from, to {
                -webkit-transform: translate3d(0, 0, 0);
                transform: translate3d(0, 0, 0);
            }

            10%, 30%, 50%, 70%, 90% {
                -webkit-transform: translate3d(-10px, 0, 0);
                transform: translate3d(-10px, 0, 0);
            }

            20%, 40%, 60%, 80% {
                -webkit-transform: translate3d(10px, 0, 0);
                transform: translate3d(10px, 0, 0);
            }
        }
        p.center{
            color: #fff;font-family: "Microsoft YaHei";
        }
        label {float: left; display: inline-block;vertical-align: middle;}
        input {
            vertical-align: middle;
        }
        p{font-size: 12px;color: #999999;}

	  .header img {display: block; width: 100%; height: 100%}
	  .hot-title img {display: block; width: 100%; height: 100%}
      .app{margin: 0 auto;position: relative;max-width: 750px;}
      .htmleaf-container{display:none;position: absolute;left: 45px;top: 0px;}
	 </style>
    <script>
        //服务端直接赋值参数
        var wgdata;

        $(document).ready(function () {
            if (!wgdata) {
     			$.post('/v31/share-video?vid=' + getQueryString('vid'), function (data) {
                    if (data.result) {
                        initData(data, initEvent);
                    } else {
                        if (!getQueryString('again')) {
                            window.location.href = window.location.pathname + '?vid=1963&again=1';
                        }
                    }
                });

            } else {
                initData(wgdata, initEvent);
            }
        })

        //初始化事件
        function initEvent() {
            //点击展示图片播放
            $('.video-img,#play-f').click(function () {
                wgplay();
                startPaly();
            })
            //点击播放按钮播放
            $('#play-t').click(function () {
                startPaly();
            })
            //点击视频画面后暂停
            $('#video_html5').click(function () {
                stopPaly();
            })
            //关闭视频播放层
            $('#close').click(function () {
                stopPaly();
                wgclose();
            })

            var video = document.getElementById('video_html5');

            video.addEventListener('playing', function () {
                $('#play-t').hide();
            })

            video.addEventListener('pause', function () {
                $('#play-t').show();
            })
        }

        //初始化绑定数据
        function initData(d, callfun) {
            var anchor = d.data;
            //主播展示图片
            $("#wgPoster").css('background-image', 'url(' + anchor.cover.url + ')')
            //主播头像
            $("#wgHeadimg-t,#wgHeadimg-p").attr("src", anchor.avatar.url);
            //主播名称
            $("#wgName").html(anchor.nickname);
            //点赞数量
            $("#follow").html(numberFormat(anchor.follow));
            //关注数量
            $("#seeNum").html(numberFormat(anchor.seeNum));
            //分享数量
            $("#shareNum").html(numberFormat(anchor.shareNum));
            //视频播放资源
            $("#video_html5").append('<source src=" ' + anchor.url + ' ">');
            //热门主播列表数据
            d.list.forEach(function (item) {
                //主播展示图片 poster
                //主播头像 headimg
                //主播姓名 name
                //点赞数量 nicecount
                //<img src="' +item.poster +'" alt="">
                var html =
                    '<div class="video-item"><a href="javascript:void(0)"><div class="item-img" style="background-image: url(' +
                    item.cover.url +
                    ')"></div><div class="video-content"><div class="content-explain"><img class="app-img-1" src="' +
                    item.avatar.url + '" alt=""><div class="ce-c"><p>' + item.title +
                    '</p><div class="ce-count"><img class="app-img-2" src="images/nice_2.png" alt=""><p>' +
                    numberFormat(item.follow) +
                    '</p></div></div></div></div></a></div>';
                $("#videoList").append(html);
            });
            //所有dom加载完成后将所有点击链接修改到下载资源链接
            $('a').attr("href", d.url);
            //当数据dom加载完成后执行回调注册各个按钮的事件
            callfun();
        }

        //开始播放
        function startPaly() {
            document.getElementById('video_html5').play();
        }

        //暂停播放
        function stopPaly() {
            document.getElementById('video_html5').pause();
        }

        //关闭视频播放层
        function wgclose() {
            $('.header').removeClass('header-paly');
            $('.video-play').hide();
            $('.video-box,.video-hot').show();
        }

        //打开视频播放层
        function wgplay() {
            //因视频播层级显示问题，故此隐藏其它模块
            $('.video-box,.video-hot').hide();
            //显示视频播放
            $('.video-play').show();
            //更改头部样式
            $('.header').addClass('header-paly');
        }
        //获取地址栏参数
        function getQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]);
            return null;
        }

        //数字格式化
        function numberFormat(n) {
            if (typeof (n) === 'number') {
                var c = parseFloat(n / 10000).toFixed(1);
                return c > 0 ? c + 'W' : n;
            }else{
                return n;
            }
        }
	
		// 控制弹窗浮层
	function downurl(){
        if($('.htmleaf-container').hasClass('show')){
             $('.htmleaf-container').removeClass('show').hide();
        }else{
            $('.htmleaf-container').addClass('show').show();
        }
        
	}
	
      //校验验证码
    function checkmsg(){
        var phone = $("#phone").val();
        var uid = getParameterByName('uid');
        var fxcode = getParameterByName('fxcode');
        var yzm = $("#yzm").val();
        
        if(!isPoneAvailable(phone)){
            alert("手机格式错误");
        }else{
        
            if(yzm==""){
                alert("验证码不能为空");
            }else{
                $.getJSON("http://api.tzlc51.com:8080/forgetPwd/checkCodeAndAddUidAndFid?callback=?", {phone: phone,uid:uid,fxcode:fxcode,code:yzm}, function(data) {
        
                    if (data.ret==1) {
                        $(".htmleaf-container").hide();                     
                         // 跳转下载页面
                        window.location = appurl();
                    }else {
                        
                        alert("验证码不对");
                        window.location.reload();
                    }
                }); 
             
            }
        }
    }

		//判断下载链接
    function appurl(){
        if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
            //alert(navigator.userAgent);
            return '<{$ios_url}>' ;
        } else if (/(Android)/i.test(navigator.userAgent)) {
            //alert(navigator.userAgent);
            return '<{$android_url}>';

        } else {
            return 'http://www.baidu.com/';

        };

    }

    //发生验证码
    function sendmsg(){
        var phone = $("#phone").val();

        if(!isPoneAvailable(phone)){
            alert("手机格式错误");
        }else {

        $.getJSON("http://api.tzlc51.com:8080/forgetPwd/sendMsg_Get?callback=?", {phone: phone} , function(data) {
            if (data.ret==1) {  
                    countDown();
                    $("#login").css('background','#FFCA54');
                }
            });  
        }
    }

    //验证手机号码
    function isPoneAvailable(poneInput) {
        var myreg=/^[1][3,4,5,7,8][0-9]{9}$/;
        if (!myreg.test(poneInput)) {
            return false;
        } else {
            return true;
        }
    }

    // 获取url 参数变量
    function getParameterByName(paramName) {
        var args = new Object();
        var argsStr = location.search;  //获取URL参数字符串
        if (argsStr.length > 0) {
            argsStr = argsStr.substring(1);
            var nameValueArr = argsStr.split("&");  //多参数
            for (var i = 0; i < nameValueArr.length; i++) {
                var pos = nameValueArr[i].indexOf('=');
                if (pos == -1) continue; //如果没有找到就跳过
                var argName = nameValueArr[i].substring(0, pos); //提取name
                var argVal = nameValueArr[i].substring(pos + 1); //提取value
                args[argName] = unescape(argVal);
            }
            return args[paramName];
        }
    }

    // 倒计时
    var flag = 1;
    var i = 60;
    function countDown() {
        i = i - 1;
        $('#bnt').val(i+"秒后重发");

        $('#bnt').css("background-color","#DDDDDD");
        if (i == 0) {
            $('#bnt').css("background-color","#FFCA54");
            $('#bnt').val("重新发送");
            flag = 1;
            i = 60;
            return;
        }
        setTimeout('countDown()',1000);
    }



    </script>
</head>

<body>
    <div class="app">
        <div class="header">
		<img src="__PUBLIC__/share/1.png"  onclick="downurl()">
           
        </div>
		
		
        <div class="video-box">
            <div class="video-show">
                <div class="video-img" id="wgPoster">

                </div>
                <div class="play" id="play-f">
                    <img src=""
                        alt="">
                </div>
                <div class="video-tool" onclick="downurl()">
                    <div class="tool-explain">
                        <img id="wgHeadimg-t" class="app-img-1" src="" alt="">
                        <p id="wgName"></p>
                    </div>
                    <div class="app-fans">
                        <a class="app-btn-circle small" href="javascript:void(0)">关注</a>
                    </div>
                </div>
            </div>
        </div>
        <div class="video-play">
            <div class="play" id="play-t">
                <img src=""
                    alt="">
            </div>
            <div id="close" class="close">
                <img class="app-img-3" src=""
                    alt="">
            </div>
            <div class="play-tool">
                <div class="pt-t pt-name">
                    <a href="javascript:void(0)">
                        <img id="wgHeadimg-p" class="app-img-5" src="" alt="">
                    </a>
                </div>
                <div class="pt-t">
                    <a href="javascript:void(0)">
                        <img class="app-img-3" src=""
                            alt="">
                    </a>
                    <p id="follow"></p>
                </div>
                <div class="pt-t">
                    <a href="javascript:void(0)">
                        <img class="app-img-4" src=""
                            alt="">
                    </a>
                    <p id="seeNum"></p>
                </div>
                <div class="pt-t">
                    <a href="javascript:void(0)">
                        <img class="app-img-3" src=""
                            alt="">
                    </a>
                    <p id="shareNum"></p>
                </div>
            </div>
            <video id="video_html5" class="player" webkit-playsinline="true" x5-video-player-type="h5" preload="auto" x-webkit-airplay="true"
                x5-video-player-fullscreen="true" playsinline="true" loop="loop">
            </video>
        </div>
        <div class="video-hot">
            <div class="hot-title">
               <img src="__PUBLIC__/share//3.png" alt="">
			   <img src="__PUBLIC__/share//4.png" alt="" onclick="downurl()">
            </div>
          
        </div>
		
		 
      


    </div>

       <div class="htmleaf-container" style="display:;">
    <div id="wrapper" class="login-page">
        <div id="login_form" class="form">
            <h4>验证手机号</h3>
                <p >为绑定邀请关系，只需要完成手机号验证即可体验荷尔蒙哦</p>
               
                    <label for="fname" ><img src="http://heermeng.oss-cn-hangzhou.aliyuncs.com/landing/Rectangle%205%402x.png" width="24" height="24" /></label>
                    <input type="text"  id="phone" placeholder="输入手机号"  />

                    <label for="yzm"><img src="http://heermeng.oss-cn-hangzhou.aliyuncs.com/landing/Rectangle%206%402x.png" width="24" height="24" /></label>
                    <input type="text" id="yzm" placeholder="验证码"  style="width:50%;"/>

                    <input type="button" id="bnt" value="获取验证码" onclick="sendmsg()" style="width:34%;background:#FFCA54"/>

                    <button id="login"  onclick="checkmsg()" >确 认</button>
               
        </div>
    </div>
</div>

</body>

</html>